package router

//import (
//	"embed"
//	"errors"
//	"helper-api/app/controller"
//	"helper-api/core"
//	"gitee.com/molonglove/goboot/gin"
//	"helper-api/permission"
//	"io/fs"
//	"net/http"
//	"path"
//	"path/filepath"
//	"strings"
//)
//
//type Web struct {
//	fs   embed.FS
//	path string
//}
//
//func NewWeb() *Web {
//	return &Web{
//		fs:   permission.Assets,
//		path: "html",
//	}
//}
//
//func (r *Web) Open(name string) (fs.File, error) {
//	if filepath.Separator != '/' && strings.ContainsRune(name, filepath.Separator) {
//		return nil, errors.New("http: invalid character in file path")
//	}
//	fullName := filepath.Join(r.path, filepath.FromSlash(path.Clean("/assets/"+name)))
//	fullName = filepath.ToSlash(fullName)
//	core.Log.Info("请求资源路径 => %s", fullName)
//	file, err := r.fs.Open(fullName)
//	return file, err
//}
//
//func InitHtml(engine *gin.Engine) *gin.Engine {
//	engine.StaticFS("/assets", http.FS(NewWeb()))
//	admin := engine.Group("admin")
//	{
//		admin.Any("", controller.Html.Index)
//	}
//	engine.NoRoute(controller.Html.RedirectIndex)
//	return engine
//}
